﻿FROM docker.dev.crenjoy.com/library/eclipse-temurin:21-jre-alpine

ARG GOARCH
ARG MVN_VERSION

EXPOSE 50051 8090
WORKDIR /usr/app

## 字体和时区
RUN apk add --no-cache tzdata  && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  && \
    echo "Asia/Shanghai" > /etc/timezone

## Grpc 服务
ADD jmash-storage-service/target/jmash-storage-service-${MVN_VERSION}.jar jmash-storage-service-1.0.0.jar
ADD jmash-storage-service/target/lib lib

## Grpc网关
ADD jmash-storage-gateway/bin/main_${GOARCH}  gateway
ADD jmash-storage-gateway/openapi   openapi
ADD jmash-storage-k8s/start_script.sh start_script.sh

RUN chmod +x gateway
RUN chmod +x start_script.sh

ENTRYPOINT ["./start_script.sh"]
